package com.xr.redis.pubsub.model;

import java.io.Serializable;

/**
 * @author Arnold Yand
 * @summary 发布/订阅消息模型
 * @time 2018/8/4 18:35
 */
public class Message implements Serializable{

  // 消息id，自定义
  private String msgId;

  // 消息所属频道
  private String channel;

  // 消息内容
  private Object body;

  public Message(){
    this(String.valueOf(System.currentTimeMillis()), null);
  }

  public Message(Object body){
    this(String.valueOf(System.currentTimeMillis()), body);
  }

  public Message(String msgId, Object body){
    this.msgId = msgId;
    this.body = body;
  }

  public String getMsgId() {
    return msgId;
  }

  public void setMsgId(String msgId) {
    this.msgId = msgId;
  }

  public String getChannel() {
    return channel;
  }

  public void setChannel(String channel) {
    this.channel = channel;
  }

  public Object getBody() {
    return body;
  }

  public void setBody(Object body) {
    this.body = body;
  }
}
